define([
  'views/List',
  'views/internals/FamiliarItem',
  'views/internals/FamiliarModal',
  'hbs!template/internals/familiars-list-embedded'
], function(List, FamiliarItem, FamiliarModal, template){
  var FamiliarsList = List.extend({
    itemView: FamiliarItem,
    listEvents: {
      "click button[name=add]":		"add"
    },

    initList: function(options) {
      this.template = template;
    },
    
    add: function() {
      var modal = new FamiliarModal({
        model: new this.collection.model({internal: this.model.id}),
        collection: this.collection
      });
      modal.render();
    }

  });

  return FamiliarsList;
});